<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>${appname}-<c:if test="${!empty sessionScope._local_node_session}">${sessionScope._local_node_session.nodeName}-</c:if>${si:ctname("NET_TYPE",sessionScope._netType)}</title>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">
	$(function() { 
		$('#inputForm input').tooltip(); 
		$('#inputForm').checkForm();
		$('#inputForm').ajaxForm({
			url : _ctx + "/registry/add_adapter_base.do",
			type : "post",
			dataType : "json",
			beforeSubmit : function() {
				$("#sbmBtn").attr("disabled", "disabled");
			},
			clearForm : false,
			resetForm : false,
			success : function(resp) {
				if (resp.status == '1') {
					ui.msg(resp.msg, 1);
					ui.go(_ctx + '/registry/adapter_base_list.do');
				} else {
					ui.msg(resp.msg, 0);
				}
				$("#sbmBtn").removeClass("disabled").attr("disabled", null);
			},
			error : function(resp) {
				ui.msg('请求发送失败', 0);
				$("#sbmBtn").removeClass("disabled").attr("disabled", null);
			}
		});
	});
	
	
</script>
</head>
<body>
	<%@ include file="/WEB-INF/view/common/topbar.jsp"%>
	<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<%@ include file="/WEB-INF/view/common/sidebar.jsp"%>
			<div class="main-content">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i> <a href="#">首页</a>
						</li>
						<li><a href="#">注册管理</a></li>
						<li><a href="#">适配器管理</a></li>
						<li><a href="#">适配器注册</a>
						</li>
						<li class="active">注册</li>
					</ul>
				</div>
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<div class="widget-box">
								<div class="widget-header widget-header-flat">
									<div class="widget-toolbar no-border">
										<a class="btn btn-primary btn-xs"
											href="${ctx}/registry/adapter_base_list.do"><i
											class="icon-arrow-left"></i> 返回&nbsp;&nbsp;</a>
									</div>
								</div>
								<div class="widget-body">
									<div class="widget-main">
										<form class="form-horizontal" role="form" id="inputForm"
											action="" method="post">
											<div class="space-4"></div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-2">适配器名称*</div>
												<div class="col-sm-9 ">
													<input type="text" class="col-sm-5"
														value="${vo.adapterName}" name="adapterName" id="adapterName" placeholder="适配器名称"  
														datatype="require"   msg="请填写适配器名称！"  title="必填项,2-60个字符，允许中文，英文字母、数字和符号" />
												</div>
											</div>
											<div class="space-4"></div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-2">适配器类型</div>
												<div class="col-sm-9 " style="margin-top: 7px;">
													<c:if test="${sessionScope._user_session.slAuthFlag eq 1 }">
														<input type="radio" name="adapterType" id="adapterType0"  value="0" class="ace"  checked="checked">
														<span class="lbl">&nbsp;全局</span> &nbsp;
														<input type="radio" name="adapterType" id="adapterType1"  value="1" class="ace" >
														<span class="lbl">&nbsp;局部</span> &nbsp;
													</c:if>
													<c:if test="${sessionScope._user_session.slAuthFlag eq 2 }">
														<span class="lbl" >&nbsp;局部</span> &nbsp;
														<input type="hidden" name="adapterType" id="adapterType"  value="1" >
													</c:if>
												</div>
											</div>
											<div class="space-4"></div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right">选择数据分类 *</div>
											     <div class="col-sm-9">
											    	<select class="col-sm-5"
												    	name="dataCode" id="dataCode"  datatype="require"
														msg="请选择数据分类" title="必选项，数据分类">
															<option value=''>-请选择-</option>
														  <c:forEach var="vo" items="${dataList}">
														  		<option value="${vo.dataCode}">${vo.dataName}
														  	</option>
														  </c:forEach>
													</select>
											    </div>
											</div>
											<div class="space-4"></div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-2">描述</div>
												<div class="col-sm-9 ">
													<textarea class="col-sm-5" placeholder="描述" name="remark"
														id="remark" title="描述"></textarea>
												</div>
											</div>
											<hr>
											<div class="clearfix form-group">
												<div class="col-md-offset-3 col-md-9">
													<button type="submit" class="btn btn-sm btn-info"
														id="sbmBtn">
														<i class="icon-ok bigger-110"></i>提交
													</button>
												</div>
											</div>
										</form>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>